package com.ywwl.dao.base;

import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface BaseDao<T> {

    Boolean insert(T t) throws Exception;

    Boolean update(T t) throws Exception;

    Boolean delete(@Param("id") Integer id) throws Exception;

    /**
     * 根据主键查询
     * @param id
     * @return
     * @throws Exception
     */
    T selectByPrimaryKey(@Param("id") Integer id) throws Exception;
    /**
     * 根据条件查询
     * @param hashMap
     * @return
     * @throws Exception
     */
    T selectByWhere(HashMap<String, String> hashMap) throws Exception;

    /**
     * 无条件查询集合
     * @return
     * @throws Exception
     */
    List<T> list() throws Exception;

    /**
     * 根据条件查询集合
     * @param hashMap
     * @return
     * @throws Exception
     */
    List<T> listByWhere(HashMap<String,String> hashMap) throws Exception;
}
